<template>
    <div >
      <img class="logo" src="@/assets/logo.png" alt="">
      <h3>欢迎注册网易云音乐</h3>
        <span class="mark">带*标记的为必填项</span>
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
          <el-form-item label="手机号码" class="phone" prop="phone">
            <!-- <el-form-item
                label="手机号码"
                prop="phone"
                :rules="[
                  { required: true, message: '手机号码不能为空'},
                  { type: 'number', message: '手机q必须为数字值'}
                ]"
              > -->
            <el-input class="phone" v-model="ruleForm.phone"></el-input>
          </el-form-item>
          <el-form-item class="captcha phone"  label="验证码"  prop="captcha">
            <el-input class="captcha phone" v-model="ruleForm.captcha"></el-input>
          </el-form-item>
           <el-form-item class="pass phone" label="密码" prop="pass">
            <el-input class="pass" v-model="ruleForm.pass"></el-input>
          </el-form-item>
           <el-form-item class="nickname " label="昵称" prop="nickname">
            <el-input class="nickname" v-model="ruleForm.nickname"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button class="btn" @click="resetForm('ruleForm')">注册</el-button>
          </el-form-item>
      </el-form>
    </div> 
</template>

<script>
  export default {
    data() {
      return {
        ruleForm: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        rules: {
          name: [
            { required: true, message: '请输入活动名称', trigger: 'blur' },
            { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
          ],
          region: [
            { required: true, message: '请选择活动区域', trigger: 'change' }
          ],
          date1: [
            { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
          ],
          date2: [
            { type: 'date', required: true, message: '请选择时间', trigger: 'change' }
          ],
          type: [
            { type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }
          ],
          resource: [
            { required: true, message: '请选择活动资源', trigger: 'change' }
          ],
          desc: [
            { required: true, message: '请填写活动形式', trigger: 'blur' }
          ]
        }
      };
    },
    methods: {
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
      }
    }
  }
</script>
<style>
  .logo{
    width:100%;
    height: 400px;
    margin-bottom: 80px;;
  }
  h3{
    font-size: 44px;
  }
  .el-form-item__label {
    position: relative;
    left: -240px;
    top:50px;
    float: none;
    font-size: 46px;
    line-height: 30px;
}
.el-form-item__label::before{
    content: '*';
    color: #F56C6C;
    margin-right: 4px;
}
.el-form-item {
    margin-bottom: 0.5rem;
}

.el-input__inner {
    width: 400px;
    margin-bottom: 100px;
    height: 88px;
    position: absolute;
    left: 220px;
    top: -5px;
    border: 2px solid black;
    border-radius: 15px;
}

.demo-ruleForm {
    position: relative;
}

.btn {
    position: absolute;
    left:200px;
     top:10px;
     width: 400px;
    height: 80px;
    font-size: 32px;
    border-radius: 20px;
    background: #409EFF;

}
.mark{
  position: relative;
  top:10px;
  left:14px;
  font-size: 32px;
  color: red;
}

</style>